#include<stdio.h>
#include<string.h>
#include"week_diff.h"
#include"calculate_week.h"
#include"str_to_int.h"

int week;//判断是星期几

void calculate_week(int dy,int dm,int day)
{
	char WEEK[100] = {0};
	week = (dy+dm+day-1+6)%7;
	if(week < 0)
	{
		week += 7;
	}
	if(day > 0)
	{
		switch(week)
		{
			case 0:strcpy(WEEK,"SUNDAY");break;
			case 1:strcpy(WEEK,"SMONDAY");break;
			case 2:strcpy(WEEK,"TUSEDAY");break;
			case 3:strcpy(WEEK,"WEDNDAY");break;
			case 4:strcpy(WEEK,"THURDAY");break;
			case 5:strcpy(WEEK,"FRIDAY");break;
			case 6:strcpy(WEEK,"SATURDAY");break;
		}
		printf("\nthis is day is %s\(%d\)\n\nOK!\n",WEEK,week);//输出提示信息
	}
}